#ifndef WXSCORRECTOR_H
#define WXSCORRECTOR_H

#include <wx/string.h>
#include <wx/hashmap.h>
#include <wx/hashset.h>

class wxsItemResData;
class wxsItem;


class wxsCorrector {
  public:


    wxsCorrector( wxsItemResData* Data );


    bool GlobalCheck();


    void AfterChange( wxsItem* Item );


    void BeforePaste( wxsItem* Item );


    void AfterPaste( wxsItem* Item );


    void ClearCache();

  private:


    void RebuildSets();


    void SetNewVarName( wxsItem* Item );


    void SetNewIdName( wxsItem* Item );


    bool FixVarName( wxString& Name );


    bool FixIdName( wxString& Id );

    bool IsWxWidgetsIdPrefix( const wxString& Id );

    void RebuildSetsReq( wxsItem* Item, wxsItem* Exclude );
    bool FixAfterLoadCheckNames( wxsItem* Item );
    bool FillEmpty( wxsItem* Item );
    void BeforePasteReq( wxsItem* Item );

    WX_DECLARE_HASH_SET( wxString, wxStringHash, wxStringEqual, wxStringSet );

    wxsItemResData* m_Data; ///< \brief Data object using this corrector
    wxStringSet m_Vars;     ///< \brief set of currently used variable names
    wxStringSet m_Ids;      ///< \brief set of currently used identifiers
    bool m_NeedRebuild;     ///< \brief flag indicating when Vars and Ids contain valid data
};

#endif
